<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head>

</h:head> 
<body> 

<p:layout fullPage="true" style="margin-right:70px;margin-bottom:80px;">
<p:layoutUnit id="center" position="center" style="height:100%;width:100%">
<p:growl id="messages" showDetail="true" />

<p:gmap id="gmap" center="36.890257,30.707417" zoom="13" type="HYBRID" 
	style="width:100%;height:100%"
	model="#{mapController.simpleModel}" 
	onPointClick="handlePointClick(event);" 
	widgetVar="map" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
                      <script type="text/javascript">
							var currentMarker = null;
															
							function handlePointClick(event) {
								if(currentMarker == null) {
										document.getElementById('lat').value = event.latLng.lat();
										document.getElementById('lng').value = event.latLng.lng();
														
										currentMarker = new google.maps.Marker({
							     		position:new google.maps.LatLng(event.latLng.lat(), event.latLng.lng())
										});
										map.addOverlay(currentMarker);
														
								}	
							</script>	
</p:layoutUnit>
 <p:layoutUnit id="right" position="east" collapsible="true"
                 header="Geo News" resizable="true" closable="false" style="text-align:justify;"  >
                 
                        <h:form id="frm">   
                 
                 		<h:panelGrid columns="2"  cellspacing="10px" > 
	               			<p:inputText />                  		                 		
    	   					<h:button image="busca.ico" />       		
        				</h:panelGrid>
         				</h:form>
         				<h:form>
                 		<p:accordionPanel>
                        <p:tab title="Criar Noticia">
    
                        	<h:form id="frmNoticia"> 
                        	                    
							<h:panelGrid columns="2">
						
							<h:outputLabel for="titulo" value="Titulo:" />
							<p:inputText id="titulo" 
								 required="true" value="#{noticiaController.id}">
								<f:validateLength minimum="2" />
							</p:inputText>
											
						
							
							<h:outputLabel for="subtitulo" value="Subtitulo:" />
							<p:inputText id="subtitulo" 
							 required="true" value="#{noticiaController.titulo}"/>	
							 					
				
							
							<h:outputLabel for="descricao" value="Descrição:"/>
						
							<p:inputTextarea rows="3" cols="25" id="descricao" value="#{noticiaController.texto}" />			
						
							
							<h:outputLabel for="imagem" value="Imagem:"/>						
							   <p:fileUpload value="#{fileUploadController.file}" mode="simple" /> 
							                 			
               			 
               				<h:outputLabel for="links" value="Links:"/>
               		
               				
							<p:inputText id="link1" 
							 required="false" label="link1" />
						
							 <p:inputText id="link2" 
							 required="false" label="link2"   />
						
							 <p:inputText id="link3" 
							 required="false" label="link3"  />	
							 
							 <h:inputHidden id="lat" value="#{noticiaController.lat}" />
							 <h:inputHidden id="lng" value="#{noticiaController.lng}" />
							 
						
							<p:commandButton value="Criar Noticia" ajax="false"  action="#{noticiaController.salvar}" />
												            
							</h:panelGrid>
																		
							</h:form>
							
                        </p:tab>
                    </p:accordionPanel> 

                    </h:form>
							<h:form>
	
    					<p:dataGrid var="car" value="" columns="3">  
        					<p:panel header="Comentários" style="text-align:center">  
            					<h:panelGrid columns="2" style="width:100%"> 
            						<p:graphicImage value="igor.jpg" height="40px" width="40px"/> 
                					<h:outputText value="Comentário" />  
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/> 
                					<h:outputText value="Comentário" />  
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/> 
                					<h:outputText value="Comentário" /> 
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Comentário" />  
            					</h:panelGrid>  
        					</p:panel> 
    					</p:dataGrid>  
				
					
					<p:accordionPanel>
                        <p:tab title="Histórico">  
            					<h:panelGrid columns="2" style="width:100%"> 
            						<p:graphicImage value="igor.jpg" height="40px" width="40px"/> 
                					<h:outputText value="Noticia A" />  
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/> 
                					<h:outputText value="Noticia B" />  
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/> 
                					<h:outputText value="Noticia C" /> 
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Noticia D" />  
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Noticia E" />
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Noticia F" />
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Noticia G" />
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Noticia H" />
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Noticia I" />
                					<p:graphicImage value="igor.jpg" height="40px" width="40px"/>  
                					<h:outputText value="Noticia J" />
            					</h:panelGrid>    

                        </p:tab>
                    </p:accordionPanel>
                    
					</h:form>
      
                </p:layoutUnit>	
 </p:layout>
</body> 
</html>
